package com.mvp.shq.washer.ui.shop.shopAddress;

import com.mvp.shq.washer.entity.result.BaseResult;
import com.mvp.shq.washer.entity.shop.AddressData;
import com.mvp.shq.washer.entity.shop.result.AddressResult;
import com.mvp.shq.washer.http.RxSchedulers;
import com.mvp.shq.washer.http.ShopApi;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by Administrator on 2017/10/10.
 */

public class Model implements ShopAddressConstract.Model {
    @Override
    public Observable<BaseResult<AddressResult>> getAllAddress(String token, String userId, int pageNo, int pageSize) {
        return ShopApi.getInstance().service
                .getAllAddress(token,userId,pageNo,pageSize)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> setDefAddress(String token, String userId, String ecReceiveAddressId) {
        return ShopApi.getInstance().service
                .setDefAddress(token,userId,ecReceiveAddressId)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<String>> delAddress(String token,String ecReceiveAddressId) {
        return ShopApi.getInstance().service
                .delAddress(token,ecReceiveAddressId)
                .compose(RxSchedulers.io_main());
    }
}
